<?php
/*
 * @ https://EasyToYou.eu - IonCube v11 Decoder Online
 * @ PHP 7.2 & 7.3
 * @ Decoder version: 1.1.6
 * @ Release: 10/08/2022
 */

// Decoded file for php version 71.
namespace app\card\model;

class CardType extends \app\BaseModel
{
    protected $name = "longbing_card_card_type";
    protected static function init()
    {
    }
    public function initCardType($uniacid)
    {
        $data = [["card_type" => "cardType1", "img" => "https://retail.xiaochengxucms.com/1.png", "uniacid" => $uniacid], ["card_type" => "cardType4", "img" => "https://retail.xiaochengxucms.com/2.png", "uniacid" => $uniacid], ["card_type" => "cardType2", "img" => "https://retail.xiaochengxucms.com/4.png", "uniacid" => $uniacid]];
        $result = self::createRows($data);
        return $result->toArray();
    }
    public function getCardTypeList($uniacid, $type = "")
    {
        $list = self::where([["uniacid", "=", $uniacid], ["status", "=", 1]])->select()->toArray();
        foreach ($list as $index => $item) {
            $list[$index]["selected"] = 0;
            if($item["card_type"] == $type) {
                $list[$index]["selected"] = 1;
            }
        }
        return $list;
    }
}

?>